<template>
  <div>
    <el-tabs v-model="activeName">

      <el-tab-pane name="first">
        <div slot="label" @click="myMaintenanceClick">发送的申请</div>
        <my-maintenance ref="myMaintenance"></my-maintenance>
      </el-tab-pane>

      <el-tab-pane name="second">
        <div slot="label" @click="recieveMaintenanceClick">接收的申请</div>
        <recieve-maintenance ref="recieveMaintenance"></recieve-maintenance>
      </el-tab-pane>

    </el-tabs>
  </div>
</template>
<script>
  import MyMaintenance from './module/maintenance/send-maintenance'
  import RecieveMaintenance from './module/maintenance/receive-maintenance'
  export default {
    data() {
      return {
        activeName: 'first'
      }
    },
    components: {
      MyMaintenance,
      RecieveMaintenance
    },
    activated() {
      this.myMaintenanceClick()
    },
    methods: {
      myMaintenanceClick() {
        this.$nextTick(() => {
          this.$refs.myMaintenance.getDataList()
        })
      },
      recieveMaintenanceClick() {
        this.$nextTick(() => {
          this.$refs.recieveMaintenance.getDataList()
        })
      }
    }
  }
</script>